-
Notifications
You must be signed in to change notification settings - Fork 996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1/2] Swift Concurrency migration - Financial Connections API client #4444
Conversation
2 builds increased size, 6 builds had no size change
StripeSize 1.0 (1)
|
Item | Install Size Change |
---|---|
Swift._NativeDictionary.merge(isUnique,uniquingKeysWith) | ⬆️ 4.4 kB |
Code Signature | ⬆️ 4.2 kB |
🗑 StripeFinancialConnections.NativeFlowAPIDataManager.manifest | ⬇️ -2.0 kB |
StripeFinancialConnections.NativeFlowAPIDataManager.init(manifest... | ⬇️ -1.8 kB |
StripeFinancialConnectionsSize | ⬆️ 1.3 kB |
StripeConnectSize 1.0 (1)
com.stripe.StripeConnectSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 193.3 kB (3.88%)
Total download size change: ⬆️ 67.6 kB (4.34%)
Largest size changes
Item | Install Size Change |
---|---|
Code Signature | ⬆️ 5.0 kB |
Swift._NativeDictionary.merge(isUnique,uniquingKeysWith) | ⬆️ 4.4 kB |
🗑 StripeFinancialConnections.NativeFlowAPIDataManager.manifest | ⬇️ -2.0 kB |
StripeFinancialConnections.NativeFlowAPIDataManager.init(manifest... | ⬇️ -1.8 kB |
StripeConnectSize | ⬆️ 1.3 kB |
🛸 Powered by Emerge Tools
Comment trigger: Size diff threshold of 100.00kB exceeded
🚨 New dead code detected in this PR: FinancialConnectionsAsyncAPIClient.swift:169 warning: Protocol 'FinancialConnectionsAsyncAPI' is redundant as it's never used as an existential type
FinancialConnectionsAsyncAPIClient.swift:348 warning: Protocol 'FinancialConnectionsAsyncAPI' conformance is redundant Please remove the dead code before merging. If this is intentional, you can bypass this check by adding the label ℹ️ If this comment appears to be left in error, double check that the flagged code is actually used and/or make sure your branch is up-to-date with |
0da754c
to
70bd939
Compare
323a063
to
0e1c5f1
Compare
@@ -426,6 +441,11 @@ private func PresentFinancialConnectionsSheet( | |||
) | |||
financialConnectionsSheet.apiClient.stripeAccount = stripeAccount | |||
financialConnectionsSheet.onEvent = onEvent | |||
|
|||
let elementsSessionContext = StripeCore.ElementsSessionContext( | |||
usesExperimentalAsyncAPIClient: useAsyncApiClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure that we want to have this in ElementsSessionContext
. Can we stuff it in UserDefaults
while we’re testing everything? That makes it easy to rip out again once we fully migrate over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could do that!
0e1c5f1
to
8b24b2d
Compare
8b24b2d
to
b81d579
Compare
@@ -301,6 +303,12 @@ protocol FinancialConnectionsAPI { | |||
paymentDetailsId: String, | |||
billingDetails: ElementsSessionContext.BillingDetails? | |||
) -> Future<LinkBankPaymentMethod> | |||
|
|||
func updateAvailableIncentives( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
Summary
This PR introduces a new Swift Concurrency based API client to the Financial Connections SDK, laying the groundwork for an eventual full migration. The changes are implemented in a way that allows for a gradual rollout without disrupting existing functionality. To do this, we introduce;
FinancialConnectionsAsyncAPIClient
: A new API client fully powered by Swift Concurrency.Some implementation details:
FinancialConnectionsAPI
protocol, maintaining the current interface for API client consumers throughout the SDK.This work also provides a shape for the new async API. The current API is shaped as:
While the new API is shaped as:
A toggle has been added to the FC example app to switch between API client implementations. This is currently the only way to test the async API client:
Motivation
Move towards migration to Swift Concurrency
Next Steps: Part 2 will focus on migrating existing consumers to use the new async API client.
Testing
Unit tests added, and manual testing done.
Screen.Recording.2025-01-08.at.1.47.18.PM.mov
Changelog
N/a